import org.junit.Test;

public class tt {
    public static void main(String[] args) {
        int arr[] = {1,2,3,4};
        text(arr,0);
    }
    public static void text(int arr[],int index){
        /*int i;
        for (i = 0;i < arr.length;i++){
            System.out.print("{"+arr[i]+"}");
            for (int j = arr.length-1;j > i;j--){
                System.out.print("{"+arr[i]+","+arr[j]+"}");
            }
        }
        System.out.println("{"+"null"+"}");*/
        if (index == arr.length){
            System.out.println("{"+" "+"}");
        }else {
            int i;
            int j = index + 1;
            while (j < arr.length){
                System.out.print("{"+arr[index]);
                for (i = j;i < arr.length;i++){
                    System.out.print(",");
                    System.out.print(arr[i]);
                }
                System.out.print("}");
                j++;
            }
            index++;
            text(arr,index);
        }
    }

    @Test
    public void ttt(){
        String a = "abc";
        String b = new String("abc");
        System.out.println(a.equals(b));
    }

}
